/* 
 * File:   TokenFactory.cpp
 * Author: maximiliano
 * 
 * Created on 15 de junio de 2013, 09:56
 */

#include "common_TokenFactory.h"
#include <sstream>

using namespace std;
using namespace TP::Comunicacion;

uint32_t TokenFactory::Crear(){
    
    static uint32_t token = 0;
    
    token ++;
    return token;
}

uint32_t TokenFactory::Parse (const string &pValor){
    
    uint32_t token;
    
    stringstream strstm;
    strstm << pValor;
    strstm >> token;
    
    return token;
}

string TokenFactory::AString (const uint32_t &pValor){
    
    std::stringstream strstm;
    strstm << pValor;
    
    return strstm.str();
}